<template>
  <div>我是子组件-----{{ xxx }}</div>
  <button @click="btnClick">调用方法</button>
</template>
<script setup>
import { inject } from 'vue'

const xxx = inject('xxx')
const fn = inject('fn')
const btnClick = () => {
  fn(Date.now())
}
</script>
<style></style>
